package xyz.eden.cloud.common.core.exception;

import lombok.Getter;
import xyz.eden.cloud.common.core.result.ResultSetEnum;

/**
 * 业务异常
 */
@Getter
public class BusinessException extends RuntimeException {

    protected Integer code;
    protected String message;

    public BusinessException(String message) {
        super(message);
        this.code = ResultSetEnum.ERROR_BUSINESS.getCode();
        this.message = message;
    }

    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public BusinessException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
}
